package com.example.config;

import com.example.entity.properties.TxOssProperties;
import com.example.util.TxOssUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TxOssConfiguration {
    @Bean
    public TxOssUtil getTxOssUtil(TxOssProperties properties){
        String secretId = properties.getSecretId();
        String secretKey = properties.getSecretKey();
        String bucketName = properties.getBucketName();
        String regionName = properties.getRegionName();
        return new TxOssUtil(secretId, secretKey, bucketName, regionName, properties.getFolderName());
    }
}
